<?php
namespace Common\Model;
use Common\Model\BaseModel;
use Think\Model;

/**
 * Class KeyToValueModel
 * @package Admin\Model
 * 键值对模型
 */
class KeyToValueModel extends BaseModel {
    public $pix = "";
    public $fieldsStr = '*';
    public $orderStr = 'id asc';

    public function get_value($key=''){
        if(!$key){
            return false;
        }
        $map['key'] = array('eq', $key);
        $one = $this->where($map)->find();
        return $one ? $one['value'] : false;
    }

}